<?php
/**
 * Description
 *
 * PHP version 7
 *
 * @category Custom
 * @package  Custom
 * @author   ryu <mo5467@126.com>
 * @date     2020-04-29 01:23:37
 * @lastTime 2020-04-29 01:25:21
 * @license  https://opensource.org/licenses/MIT MIT License
 * @link     none
 */
namespace Design\Behavioral\Visitor;


class User implements Role
{

    private $name;


    public function __construct(string $name)
    {
        $this->name = $name;

    }//end __construct()


    public function getName(): string
    {
        return sprintf('User %s', $this->name);

    }//end getName()


    public function accept(RoleVisitor $visitor)
    {
        $visitor->visitUser($this);

    }//end accept()


}//end class
